<?php
$title = $this->form->getTitle();
$submit = $this->form->getElement('submit')->renderViewHelper();
$tagFormStart = substr($this->form->renderForm(), 0, -strlen('</form>'));
$this->form->removeElement('submit');
$this->form->removeDecorator('form');
$this->form->removeDecorator('FormTitle');
?>
<div id="smart-modal-<?= uniqid() ?>" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 id="myModalLabel"><?= $title ?></h3>
    </div>
    <?= $tagFormStart ?>
    <div class="modal-body">
        <?= $this->form ?>
    </div>
    <div class="modal-footer">
        <button class="btn" data-dismiss="modal" aria-hidden="true"><?= $this->translate('XXX_MODAL_CLOSE') ?></button>
        <?= $submit ?>
    </div>
    <?= '</form>' ?>
</div>